import request from '@/utils/request'
import i18n from '@/i18n'

export function attributes(deviceId) {
  return request({
    url: '/query/info/attributes/' + deviceId,
    method: 'get',
  })
}

export function online(deviceId) {
  return request({
    url: '/query/info/online/' + deviceId,
    method: 'get',
  })
}

export function disconnect(deviceId) {
  return request({
    url: '/query/info/disconnect/' + deviceId,
    method: 'get',
  })
}

export function clearVersionFileCache() {
  return request({
    url: '/query/info/clearVersionFileCache',
    method: 'get',
  })
}

export function lastGps(deviceId) {
  return request({
    url: '/query/info/lastGps/' + deviceId,
    method: 'get',
  })
}

export function lastBatteryLowFrequencyL(deviceId) {
  return request({
    url: '/query/info/lastBatteryLowFrequencyL/' + deviceId,
    method: 'get',
  })
}

export function lastBatteryLowFrequencyH(deviceId) {
  return request({
    url: '/query/info/lastBatteryLowFrequencyH/' + deviceId,
    method: 'get',
  })
}

export function lastBodyFaultCode(deviceId) {
  return request({
    url: '/query/info/lastBodyFaultCode/' + deviceId,
    method: 'get',
  })
}

export const ATTRIBUTE_NAMES = [
  {"value": "acc", "label": i18n.t('query.attributeNames.acc')},
  {"value": "VIN", "label": i18n.t('query.attributeNames.VIN')},
  {"value": "phone", "label": i18n.t('query.attributeNames.phone')},
  {"value": "iccid", "label": i18n.t('query.attributeNames.iccid')},
  {"value": "imsi", "label": i18n.t('query.attributeNames.imsi')},
  {"value": "gsmSignal", "label": i18n.t('query.attributeNames.gsmSignal')},
  {"value": "gpsSignal", "label": i18n.t('query.attributeNames.gpsSignal')},
  {"value": "bluetoothVersion", "label": i18n.t('query.attributeNames.bluetoothVersion')},
  {"value": "bluetoothName", "label": i18n.t('query.attributeNames.bluetoothName')},
  {"value": "flash", "label": i18n.t('query.attributeNames.flash')},
  {"value": "ecuId", "label": i18n.t('query.attributeNames.ecuId')},
  {"value": "hardwareVersionNumber", "label": i18n.t('query.attributeNames.hardwareVersionNumber')},
  {"value": "softwareVersionNumber", "label": i18n.t('query.attributeNames.softwareVersionNumber')},
  {"value": "batteryVoltage", "label": i18n.t('query.attributeNames.batteryVoltage')},
  {"value": "remainMileage", "label": i18n.t('query.attributeNames.remainMileage')},
  {"value": "vehiclePowerOnMethod", "label": i18n.t('query.attributeNames.vehiclePowerOnMethod')},
  {"value": "vehicleStatusFeedback", "label": i18n.t('query.attributeNames.vehicleStatusFeedback')},
  {"value": "unableSolveFeedbackP", "label": i18n.t('query.attributeNames.unableSolveFeedbackP')},
  {"value": "absActivation", "label": i18n.t('query.attributeNames.absActivation')},
  {"value": "instrumentTotalMileage", "label": i18n.t('query.attributeNames.instrumentTotalMileage')},
  {"value": "speed", "label": i18n.t('query.attributeNames.speed')},
  {"value": "trip", "label": i18n.t('query.attributeNames.trip')},
  {"value": "odoTotalMileage", "label": i18n.t('query.attributeNames.odoTotalMileage')},
  {"value": "avgSpeed", "label": i18n.t('query.attributeNames.avgSpeed')},
  {"value": "maxSpeed", "label": i18n.t('query.attributeNames.maxSpeed')},
  {"value": "alarmStatus", "label": i18n.t('query.attributeNames.alarmStatus')},
  {"value": "lockStatus", "label": i18n.t('query.attributeNames.lockStatus')},
  {"value": "faultStatus", "label": i18n.t('query.attributeNames.faultStatus')},
  {"value": "pStatus", "label": i18n.t('query.attributeNames.pStatus')},
  {"value": "speedGearStatus", "label": i18n.t('query.attributeNames.speedGearStatus')},
  {"value": "brakingStatus", "label": i18n.t('query.attributeNames.brakingStatus')},
  {"value": "cruisingConditionStatus", "label": i18n.t('query.attributeNames.cruisingConditionStatus')},
  {"value": "highTempSheddingStatus", "label": i18n.t('query.attributeNames.highTempSheddingStatus')},
  {"value": "standingSlopeStatus", "label": i18n.t('query.attributeNames.standingSlopeStatus')},
  {"value": "rampDescentStatus", "label": i18n.t('query.attributeNames.rampDescentStatus')},
  {"value": "lossReportStatus", "label": i18n.t('query.attributeNames.lossReportStatus')},
  {"value": "limpStatus", "label": i18n.t('query.attributeNames.limpStatus')},
  {"value": "nonShiftFeedbackStatus", "label": i18n.t('query.attributeNames.nonShiftFeedbackStatus')},
  {"value": "gpsStatus", "label": i18n.t('query.attributeNames.gpsStatus')},
  {"value": "bluetoothConnectStatus", "label": i18n.t('query.attributeNames.bluetoothConnectStatus')},
  {"value": "instrumentBluetooth", "label": i18n.t('query.attributeNames.instrumentBluetooth')},
  {"value": "powerSupplyStatus", "label": i18n.t('query.attributeNames.powerSupplyStatus')},
  {"value": "frontTireTemp", "label": i18n.t('query.attributeNames.frontTireTemp')},
  {"value": "backTireTemp", "label": i18n.t('query.attributeNames.backTireTemp')},
  {"value": "frontTirePressure", "label": i18n.t('query.attributeNames.frontTirePressure')},
  {"value": "backTirePressure", "label": i18n.t('query.attributeNames.backTirePressure')},
  {"value": "hSoc", "label": i18n.t('query.attributeNames.hSoc')},
  {"value": "hSoh", "label": i18n.t('query.attributeNames.hSoh')},
  {"value": "lSoc", "label": i18n.t('query.attributeNames.lSoc')},
  {"value": "lSoh", "label": i18n.t('query.attributeNames.lSoh')},
  {"value": "hBatteryVoltage", "label": i18n.t('query.attributeNames.hBatteryVoltage')},
  {"value": "lBatteryVoltage", "label": i18n.t('query.attributeNames.lBatteryVoltage')},
  {"value": "fullTimeChargePack1", "label": i18n.t('query.attributeNames.fullTimeChargePack1')},
  {"value": "hChargeStatus", "label": i18n.t('query.attributeNames.hChargeStatus')},
  {"value": "metricOrImperial", "label": i18n.t('query.attributeNames.metricOrImperial')},
  {"value": "hChargeEndStatus", "label": i18n.t('query.attributeNames.hChargeEndStatus')},
  {"value": "fullTimeChargePack2", "label": i18n.t('query.attributeNames.fullTimeChargePack2')},
  {"value": "lChargeStatus", "label": i18n.t('query.attributeNames.lChargeStatus')},
  {"value": "lChargeEndStatus", "label": i18n.t('query.attributeNames.lChargeEndStatus')},
  {"value": "hBatteryWorkStatus", "label": i18n.t('query.attributeNames.hBatteryWorkStatus')},
  {"value": "lBatteryWorkStatus", "label": i18n.t('query.attributeNames.lBatteryWorkStatus')},
  {"value": "seatLockStatus", "label": i18n.t('query.attributeNames.seatLockStatus')},
  {"value": "tailBoxLockStatus", "label": i18n.t('query.attributeNames.tailBoxLockStatus')},
]
